<template>
	<view class="mons">
		<view class="list">

			<!-- <view class="li">
				清除缓存
				<view class="rig">
					<text>95.5M</text>
					<image src="../../static/img/3/3-99.png" mode="widthFix"></image>
				</view>
			</view> -->
			<navigator url="/pages/user/sysFk" class="li">
				意见反馈
				<view class="rig">
					<image src="../../static/img/3/3-99.png" mode="widthFix"></image>
				</view>
			</navigator>
			<navigator url="/pages/user/sysAbout" class="li">
				关于我们
				<view class="rig">

					<image src="../../static/img/3/3-99.png" mode="widthFix"></image>
				</view>
			</navigator>
			<!-- <navigator url="/pages/user/sysBb" class="li">
				版本说明
				<view class="rig">
					<image src="../../static/img/3/3-99.png" mode="widthFix"></image>
				</view>
			</navigator> -->
			<navigator url="/pages/invoice/index" class="li">
				发票信息
				<view class="rig">
					<image src="../../static/img/3/3-99.png" mode="widthFix"></image>
				</view>
			</navigator>

			<!-- <navigator class="li">
				好评鼓励
				<view class="rig">
					<image src="../../static/img/3/3-99.png" mode="widthFix"></image>
				</view>
			</navigator> -->
		</view>
		<view class="out" @click="out">
			退出登录
		</view>
	</view>
</template>

<script>
	function onBridgeReady() {
	    console.log('WeixinJSBridge',WeixinJSBridge);
	    WeixinJSBridge.call("closeWindow");
	}
	function wxback() {
	    if (typeof WeixinJSBridge === "undefined") {
	        if (document.addEventListener) {
	            document.addEventListener('WeixinJSBridgeReady', onBridgeReady, false);
	        } else if (document.attachEvent) {
	            document.attachEvent('WeixinJSBridgeReady', onBridgeReady);
	            document.attachEvent('onWeixinJSBridgeReady', onBridgeReady);
	        }
	    } else {
	        onBridgeReady();
	    }
	}
	export default {
		name: "",
		components: {

		},
		data() {
			return {
				isWX: false
			}
		},
		onLoad() {
			let ua = window.navigator.userAgent.toLowerCase()

			// 通过正则表达式匹配ua中是否含有MicroMessenger字符串

			if (ua.match(/MicroMessenger/i) == 'micromessenger') {

				this.isWX = true


			} else {
				this.isWX = false
			}
		},
		methods: {
			out() {

				this.$SysCache.remove('token');
				this.$SysCache.remove('openid');
				if(this.isWX){
					wxback()
				}else{
					window.onCloseSuccess = function (message) {
					    console.log(message)
					  }
					  //失败回调
					  window.onCloseError = function (message) {
					    console.log(message)
					  }
					try {
						let postParam = {
							className: "BaseBridge",
							function: "closeWebView",
							successCallBack: "onSuccess",
							failCallBack: "onError"
						}
						HandBridge.postMessage(JSON.stringify(postParam));
					} catch (err) {
						console.log(err)
						uni.navigateTo({
							url: '/pages/login/login'
						})
					}
				}
				
				
			},
			// 当点击返回键时，不返回到上一页，而是直接关闭微信浏览器
			    
		}

	}
</script>

<style scoped>
	.out {
		font-size: 26rpx;
		font-family: Microsoft YaHei;
		font-weight: 400;
		color: rgba(255, 255, 255, 1);
		width: 384rpx;
		height: 77rpx;
		background: rgba(0, 0, 0, 1);
		border-radius: 39rpx;
		margin: auto;
		text-align: center;
		line-height: 77rpx;
		margin-top: 80rpx;
	}

	.list .li {
		margin-bottom: 1px;
		background: #fff;
		padding-left: 20rpx;
		padding-right: 20rpx;
		padding-bottom: 30rpx;
		padding-top: 30rpx;
		font-size: 28rpx;
		font-family: Microsoft YaHei;
		font-weight: 400;
		color: rgba(102, 102, 102, 1);
	}

	.list .li .rig {
		display: inline-block;
		float: right;
	}

	.list .li .rig image {
		display: inline-block;
		width: 16rpx;
		vertical-align: middle;
		margin-left: 19rpx;
	}

	.list .li .rig text {
		display: inline-block;
		vertical-align: middle;
	}

	uni-page-body {
		height: 100%;
	}

	.mons {
		height: 100%;
		background: #EEEEEE;
	}

	.top {
		background: url(../../static/img/3/3-35.png) no-repeat;
		background-size: 100% 100%;
		padding-top: 65rpx;
		padding-bottom: 65rpx;
	}

	.head {
		width: 124rpx;
		height: 124rpx;
		display: block;
		background: rgba(255, 255, 255, 0.53);
		border: 1px solid rgba(255, 255, 255, 0.53);
		border-radius: 50%;
		margin: auto;
	}

	.head image {
		display: block;
		width: 102rpx;
		height: 102rpx;
		background: rgba(255, 255, 255, 1);
		border-radius: 50%;
		margin: auto;
		margin-top: 10rpx;
	}

	.name {
		text-align: center;
		font-size: 26rpx;
		font-family: Microsoft YaHei;
		font-weight: 400;
		color: rgba(255, 255, 255, 1);
		margin-top: 17rpx;
	}
</style>
